﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Ylh.Data;
using Ylh.ElvModel;
using System.Data;
using Ylh.Enums;

namespace Ylh.ElvBLL
{
    public class CompetenceElvBLL
    {
        /// <summary>
        /// [ORM]根据编号获取权限信息
        /// </summary>
        /// <param name="ConStr"></param>
        /// <param name="ID">编号</param>
        /// <param name="IsParent">指定编号是否是父节点编号</param>
        /// <returns></returns>
        public DataTable GetCompetenceByID(string ConStr, decimal ID, bool? IsParent)
        {
            TbCompetence Com = new TbCompetence();
            OQLWhere where = new OQLWhere(Com);
            if (Convert.ToBoolean(IsParent))
                where.AND(Com.ParentID, OperateType.等于, ID);
            else
                where.AND(Com.CompetenceID, OperateType.等于, ID);
            return TbCompetence.Select(where, ConStr);
        }

        public DataTable GetCompetenceByCode(string ConStr)
        {
            SqlWhere where = new SqlWhere();
            where.Info = new TbCompetence() { CompetenceCode = "SysSetManger" };
            return TbCompetence.Select(where, ConStr);
        }
    }
}
